from django.db import models

class Category(models.Model):
	caption = models.CharField(max_length=16)

class ArticleType(models.Model):
	caption = models.CharField(max_length=16)

class Article(models.Model):
	title = models.CharField(max_length=32)
	content = models.CharField(max_length=255)

	# 放内存里，节约数据多表查询时资源
	type_choice = ((1,'python'),(2,'linux'),(3,'shell'),)
	article_type_id = models.IntegerField(choices=type_choice)

	category = models.ForeignKey(to='Category', on_delete=None)
	# article_type = models.ForeignKey(to='ArticleType', on_delete=None)